package com.example.controller;

import com.example.common.Result;
import com.example.entity.Institutions;
import com.example.service.InstitutionsService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/institution")
public class InstitutionsController {
    @Resource
    private InstitutionsService institutionsService;

    @PostMapping("/add")
    public Result add(@RequestBody Institutions institutions){
        return institutionsService.add(institutions);
    }
    @PostMapping("/delete")
    public Result delete(@RequestBody Institutions institutions){
        return institutionsService.delete(institutions);
    }
    @PostMapping("/update")
    public Result update(@RequestBody Institutions institutions){
        return institutionsService.update(institutions);
    }
    @PostMapping("/search")
    public Result search(@RequestBody Institutions institutions){
        return institutionsService.search(institutions);
    }
    @PostMapping("/get")
    public Result get(@RequestBody Institutions institutions){
        return institutionsService.get(institutions);
    }
    @PostMapping("/list")
    public Result list(){
        return institutionsService.list();
    }
    @PostMapping("/listAll")
    public Result listAll(){
        return institutionsService.listAll();
    }
}
